/*
 * All content copyright http://www.j2eefast.com, unless
 * otherwise indicated. All rights reserved.
 * No deletion without permission
 */
package com.j2eefast.flowable.bpm.service;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.j2eefast.common.core.page.Query;
import com.j2eefast.common.core.utils.PageUtil;
import com.j2eefast.flowable.bpm.entity.BpmFormDefinitionEntity;
import com.j2eefast.flowable.bpm.entity.ProjectArchivesEntity;
import com.j2eefast.flowable.bpm.mapper.FormDefinitionMapper;
import com.j2eefast.flowable.bpm.mapper.ProjectArchivesMapper;
import com.j2eefast.framework.utils.Constant;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p></p>
 *
 * @author: zhouzhou
 * @date: 2020-04-18 23:47
 * @web: http://www.j2eefast.com
 * @version: 1.0.1
 */
@Service
@Transactional(readOnly = true)
public class ProjectArchivesService extends ServiceImpl<ProjectArchivesMapper, ProjectArchivesEntity> {

	@Resource
	protected ProjectArchivesMapper projectArchivesMapper;


	/**
	 * 页面展示查询翻页
	 */
	public PageUtil findPage(Map<String, Object> params) {
		String name = (String) params.get("name");
		Page<ProjectArchivesEntity> page = projectArchivesMapper.findPage(	new Query<FormDefinitionMapper>(params).getPage(),
				StrUtil.nullToDefault(name,""),
				(String) params.get(Constant.SQL_FILTER));
		return new PageUtil(page);
	}

	public ProjectArchivesEntity getById(Long deploymentId){
		return this.projectArchivesMapper.getById(deploymentId);
	}


}
